﻿using GDPView.Database;
using GDPView.Models;
using Microsoft.EntityFrameworkCore;

namespace GDPView.Services
{
    public class GDPGrowthRateDataRepository : IGDPGrowthRateDataRepository
    {
        private readonly AppDbContext _context;
        public GDPGrowthRateDataRepository(AppDbContext context)
        {
            _context = context;
        }
        public async Task<IEnumerable<GDPGrowthRateData>> GetGDPGrowthRateDatasAsync()
        {
            return await _context.GDPGrowthRateDatas.OrderBy(x => x.GDPYear).ToListAsync();
        }
    }
}
